package com.pcbly.web.components.utils.template.dwr.service;

import com.pcbly.web.bean.news.NewsBean;
import com.pcbly.web.components.utils.template.AbstractModel;

public class ModelCommonService {
	@SuppressWarnings("unchecked")
	public void execute(Class clz) {
		AbstractModel model = new ModelService(clz);
		model.setTableName(tableName);
		model.execute();

		model = new ModelServiceXml(clz);
		model.setTableName(tableName);
		model.execute();

		model = new ModelServiceImp(clz);
		model.setTableName(tableName);
		model.execute();

	}

	private String tableName;

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public static void main(String[] args) {
		ModelCommonService model = new ModelCommonService();
		model.setTableName("t_news");
		model.execute(NewsBean.class);
	}
}
